<!--  <div class="vernav2 iconmenu">
    	<ul>
       {{foreach from=$menudb item=li key=key}}
       		{{if count($li)>1}}
            	<li><a href="#formsub" class="editor">{{$key}}</a>
                    <span class="arrow"></span>
                    <ul id="formsub" style="display: block;">
                {{foreach from=$li item=o key=s}}
                	{{if $o.rank !=2}}
                    
                   
                    <li {{if $o['power']==$currentfile}} class="current"{{/if}}><a href="{{$o['link']}}">{{$s}}</a></li>
                    {{/if}}
                {{/foreach}}
                </ul>
            </li>
            {{else}}
            	 {{foreach from=$li item=o key=s}}
            <li  {{if $o['power']==$currentfile}} class="current"{{/if}}><a href="{{$o['link']}}" >{{$key}}</a></li>
            	 {{/foreach}}
            {{/if}}
        	
          {{/foreach}}
        </ul>
        <a class="togglemenu"></a>
        <br /><br />
    </div>--><!--leftmenu-->
    
    
    </div>
    {{if $newproductlist}}
    <div class="ui-dialog">
    	<div class="ui-dialog-titlebar">当前需要你上架的新商品</div>
        	<div class="ui-dialog-content">
            	<ul class="newproductlist">
             {{foreach from=$newproductlist item=li key=key}}
             	 <li><a href="/product/productlist?other={{$li.sku}}" target="_blank" title="{{$li.name}}"><img src="{{$li.thumb_url}}" /></a>
                 <span>{{$li.sku}}
                 <a href="javascript:void(0);" onClick="sureAdd({{$li.id}},1,1,2);">上架</a> |<a href="javascript:void(0);" onClick="sureAdd({{$li.id}},2,0,2);">取消</a>
                   </span>
                 </li>
             {{/foreach}}
          		  </ul>
                  <div style="clear:both"></div>
            </div>
    </div>
    
    <!-- 模态框（Modal）交运内容 -->
<form action="/externalBuy/doRecommendGoods" enctype="multipart/form-data" method="post" name="dorecommendattributeform" id="dorecommendattributeform" target="_blank" style="font-size: 14px;font-family: Helvetica, 'Hiragino Sans GB', 'Microsoft Yahei', '微软雅黑', Arial, sans-serif;line-height: 21px;color: #666;">
    <div class="modal" id="headsdorecommendform" tabindex="-1" role="dialog" aria-labelledby="sexpressform" aria-hidden="true" style="margin-top: 60px;padding-top:60px;">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"
                            aria-hidden="true" onClick="javascript:$('#headsdorecommendform').hide();">× </button>
                    <h4 class="modal-title"><span id="addsure" style="font-size:18px;">确认上架</span></h4>
                </div>
                <div class="modal-body">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td align="left" width="20%"><span id="showname">上架地址</span></td>
                            <td align="left" width="80%">
                                <span id="settext">
                                    <input type="text" value="" name="address" id="address" />
                                </span>
                            </td>
                        </tr>
                    </table>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default"
                                data-dismiss="modal" style="display:none"> 关闭 </button>
                        <input type="hidden" name="flag" id="flag" value="">
                        <input type="hidden" name="extIds" id="extIds" value="">
                         <input type="hidden" name="types" id="types" value="">
                        <button type="button" class="btn btn-primary"  onclick="sureAdd(0,3,9)">保存</button>
                    </div>
                </div>
                <!-- /.modal-content -->
            </div>
            <!-- /.modal-dialog -->
        </div>
    </div>
</form>
    
     <script>
    //确认上架
    function sureAdd(id,add_flag,iscancel,types) {
        if(add_flag == 1){
            $("#addsure").text("确认上架");
            $("#showname").text("上架链接地址");
            $("#settext").html('<input type="text" value="" name="address" id="address" placeholder="请输入链接地址,例:http://www.baidu.com" />');
            $("#flag").val(1);
            $("#extIds").val(id);
			$("#types").val(types);
			$('#headsdorecommendform').modal('show');
        }
        if(add_flag==2){
            $("#addsure").text("取消上架");
            $("#showname").text("取消原因");
            var str = "<input type='radio' name='reason'  value='1'>商品涉及侵权<br/>";
                str+="<input type='radio' name='reason'  value='2'>商品成本过高<br/>";
                str+="<input type='radio' name='reason'  value='3' >其他原因&nbsp;&nbsp;";
                str+="<input type='text'  name='address' id='address' placeholder='请输入取消原因'/>";

            $("#settext").html(str);
            $("#flag").val(2);
            $("#extIds").val(id);
			$("#types").val(types);
			$('#headsdorecommendform').modal('show');
        }
        if(add_flag ==3){
            var id = $("#extIds").val();
			var types = $("#types").val();
            var flag = $("#flag").val(); //1为商品上架，2为取消商品上架
            var address = $("#address").val();

                if(flag==1){
                    if(!address){
                         alert("链接地址不能为空"); return false;
                    }
                }
                if(flag==2){
                    var reason = document.getElementsByName('reason');
                    for(var i=0;i<reason.length;i++){
                        if(reason[i].checked==true){
                            var reason_value = reason[i].value;
                        }
                    }
                    if(reason_value==1){
                        var address = "商品涉及侵权";
                    }
                    if(reason_value==2){
                        var address = "商品成本过高";
                    }
                    if(reason_value==3){
                        var address = $("#address").val();
                        if(!address){
                            alert("请填写取消原因");return false;
                        }
                    }
                }

             $.post("/welcome/ajaxbutton", {"op": "sureAddGoods","id":id,"address":address,"flag":flag,"types":types},
             function(data){
                            if(data==200)
                            {
                                alert("成功!");
                                window.location.reload();
                            }else{
                                alert("失败");return false;
                            }
                        },"text");
            //$("#dorecommendform").hide();
        }

    }
    
   
</script>
    {{/if}}